<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>1.关于数组的描述，下列说法正确的是？ （选择两项） |  zfy的个人博客</title>
    <meta name="generator" content="VuePress 1.9.7">
    <link rel="icon" href="./img/Scorpio.png">
    <link rel="stylesheet" href="./css/style.css">
    <meta name="description" content="My tech blog">
    
    <link rel="preload" href="./assets/css/0.styles.cfdaa54c.css" as="style"><link rel="preload" href="./assets/js/app.7878252f.js" as="script"><link rel="preload" href="./assets/js/2.877879cc.js" as="script"><link rel="preload" href="./assets/js/80.7252ac50.js" as="script"><link rel="prefetch" href="./assets/js/10.a489e96f.js"><link rel="prefetch" href="./assets/js/11.f6f26a2f.js"><link rel="prefetch" href="./assets/js/12.8a827e29.js"><link rel="prefetch" href="./assets/js/13.e420b04a.js"><link rel="prefetch" href="./assets/js/14.52f00cc6.js"><link rel="prefetch" href="./assets/js/15.ef68d553.js"><link rel="prefetch" href="./assets/js/16.c2999dfd.js"><link rel="prefetch" href="./assets/js/17.0adb748c.js"><link rel="prefetch" href="./assets/js/18.2c077020.js"><link rel="prefetch" href="./assets/js/19.013b5e02.js"><link rel="prefetch" href="./assets/js/20.bb3b854e.js"><link rel="prefetch" href="./assets/js/21.28efc78c.js"><link rel="prefetch" href="./assets/js/22.4a1d71dd.js"><link rel="prefetch" href="./assets/js/23.605a5451.js"><link rel="prefetch" href="./assets/js/24.66bf035d.js"><link rel="prefetch" href="./assets/js/25.fbe72655.js"><link rel="prefetch" href="./assets/js/26.3f374d1f.js"><link rel="prefetch" href="./assets/js/27.556ea617.js"><link rel="prefetch" href="./assets/js/28.0cab868b.js"><link rel="prefetch" href="./assets/js/29.564f8747.js"><link rel="prefetch" href="./assets/js/3.4cfb1b9c.js"><link rel="prefetch" href="./assets/js/30.c4a099d1.js"><link rel="prefetch" href="./assets/js/31.7fbc3d2a.js"><link rel="prefetch" href="./assets/js/32.8f356b20.js"><link rel="prefetch" href="./assets/js/33.b5a1b0bb.js"><link rel="prefetch" href="./assets/js/34.57086c2e.js"><link rel="prefetch" href="./assets/js/35.2b4d0231.js"><link rel="prefetch" href="./assets/js/36.a99f6d64.js"><link rel="prefetch" href="./assets/js/37.eb25dcef.js"><link rel="prefetch" href="./assets/js/38.e45d8594.js"><link rel="prefetch" href="./assets/js/39.213e3a72.js"><link rel="prefetch" href="./assets/js/4.b86a0fbe.js"><link rel="prefetch" href="./assets/js/40.cadafdd6.js"><link rel="prefetch" href="./assets/js/41.23b0f26d.js"><link rel="prefetch" href="./assets/js/42.7c2b83c6.js"><link rel="prefetch" href="./assets/js/43.62f328ea.js"><link rel="prefetch" href="./assets/js/44.c4dfbd34.js"><link rel="prefetch" href="./assets/js/45.cde5bb22.js"><link rel="prefetch" href="./assets/js/46.6c62bdb8.js"><link rel="prefetch" href="./assets/js/47.4857766a.js"><link rel="prefetch" href="./assets/js/48.55a0cccc.js"><link rel="prefetch" href="./assets/js/49.3dceda91.js"><link rel="prefetch" href="./assets/js/5.13776f82.js"><link rel="prefetch" href="./assets/js/50.ab4d52fa.js"><link rel="prefetch" href="./assets/js/51.69ccc35a.js"><link rel="prefetch" href="./assets/js/52.01f3f711.js"><link rel="prefetch" href="./assets/js/53.c146a1ff.js"><link rel="prefetch" href="./assets/js/54.71ce70c2.js"><link rel="prefetch" href="./assets/js/55.98ef481d.js"><link rel="prefetch" href="./assets/js/56.b23daa51.js"><link rel="prefetch" href="./assets/js/57.6aa314ad.js"><link rel="prefetch" href="./assets/js/58.7d6367d9.js"><link rel="prefetch" href="./assets/js/59.88894cf5.js"><link rel="prefetch" href="./assets/js/6.93d89692.js"><link rel="prefetch" href="./assets/js/60.111f9a04.js"><link rel="prefetch" href="./assets/js/61.add82aab.js"><link rel="prefetch" href="./assets/js/62.8bfac830.js"><link rel="prefetch" href="./assets/js/63.db44a5ca.js"><link rel="prefetch" href="./assets/js/64.0244f0ef.js"><link rel="prefetch" href="./assets/js/65.2be994de.js"><link rel="prefetch" href="./assets/js/66.c5066e37.js"><link rel="prefetch" href="./assets/js/67.c11b474b.js"><link rel="prefetch" href="./assets/js/68.276bdc3e.js"><link rel="prefetch" href="./assets/js/69.f5f39d50.js"><link rel="prefetch" href="./assets/js/7.ca9f7e96.js"><link rel="prefetch" href="./assets/js/70.e3ca02b0.js"><link rel="prefetch" href="./assets/js/71.befcf8f7.js"><link rel="prefetch" href="./assets/js/72.04fabafd.js"><link rel="prefetch" href="./assets/js/73.e5b707f2.js"><link rel="prefetch" href="./assets/js/74.b5668150.js"><link rel="prefetch" href="./assets/js/75.eb7cfac9.js"><link rel="prefetch" href="./assets/js/76.c1b76370.js"><link rel="prefetch" href="./assets/js/77.5875e953.js"><link rel="prefetch" href="./assets/js/78.a5e2fa5b.js"><link rel="prefetch" href="./assets/js/79.eb2d51a7.js"><link rel="prefetch" href="./assets/js/8.570c39ea.js"><link rel="prefetch" href="./assets/js/81.eb980d26.js"><link rel="prefetch" href="./assets/js/82.9e069d8f.js"><link rel="prefetch" href="./assets/js/83.8c5a6dc6.js"><link rel="prefetch" href="./assets/js/84.26baaa09.js"><link rel="prefetch" href="./assets/js/85.96bc7e77.js"><link rel="prefetch" href="./assets/js/86.9c9dd1ca.js"><link rel="prefetch" href="./assets/js/87.d54639b8.js"><link rel="prefetch" href="./assets/js/88.3d3ae1e1.js"><link rel="prefetch" href="./assets/js/89.a81caa83.js"><link rel="prefetch" href="./assets/js/9.7a58df3d.js"><link rel="prefetch" href="./assets/js/90.c3c347ed.js"><link rel="prefetch" href="./assets/js/91.b6240032.js"><link rel="prefetch" href="./assets/js/92.8331718a.js"><link rel="prefetch" href="./assets/js/93.ca174cfa.js"><link rel="prefetch" href="./assets/js/94.fec3300c.js"><link rel="prefetch" href="./assets/js/95.076b06fb.js"><link rel="prefetch" href="./assets/js/96.8ed8b32f.js">
    <link rel="stylesheet" href="./assets/css/0.styles.cfdaa54c.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/./" class="home-link router-link-active"><!----> <span class="site-name"> zfy的个人博客</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="http://127.0.0.1:3002/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  自由博客板块
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="http://zfyangelo.gitee.io/yu-weather-web-show/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  天气预报
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="/./guide/" class="nav-link router-link-active">
  个人的学习笔记
</a></div><div class="nav-item"><a href="/./baodian/interview/" class="nav-link">
  项目及在校经历
</a></div><div class="nav-item"><a href="/./baodian/talk/" class="nav-link">
  爱好和联系方式
</a></div><div class="nav-item"><a href="https://gitee.com/zfyangelo" target="_blank" rel="noopener noreferrer" class="nav-link external">
  我的gitee
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="http://127.0.0.1:3002/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  自由博客板块
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="http://zfyangelo.gitee.io/yu-weather-web-show/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  天气预报
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="/./guide/" class="nav-link router-link-active">
  个人的学习笔记
</a></div><div class="nav-item"><a href="/./baodian/interview/" class="nav-link">
  项目及在校经历
</a></div><div class="nav-item"><a href="/./baodian/talk/" class="nav-link">
  爱好和联系方式
</a></div><div class="nav-item"><a href="https://gitee.com/zfyangelo" target="_blank" rel="noopener noreferrer" class="nav-link external">
  我的gitee
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav>  <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>HTML</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>CSS</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Javascipt</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>HTML&amp;CSS练习</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>Javascipt练习</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/./guide/notes/jswork/01-认识javascript.html" class="sidebar-link">01-认识javaScript</a></li><li><a href="/./guide/notes/jswork/02-变量与数据类型.html" class="sidebar-link">02-变量与数据类型</a></li><li><a href="/./guide/notes/jswork/03-DOM.html" class="sidebar-link">03-DOM</a></li><li><a href="/./guide/notes/jswork/04-表达式和操作符.html" class="sidebar-link">04-表达式和操作符</a></li><li><a href="/./guide/notes/jswork/05-判断.html" class="sidebar-link">05-判断</a></li><li><a href="/./guide/notes/jswork/06-循环.html" class="sidebar-link">06-循环</a></li><li><section class="sidebar-group collapsable is-sub-group depth-1"><p class="sidebar-heading"><span>07-暂无</span> <span class="arrow right"></span></p> <!----></section></li><li><a href="/./guide/notes/jswork/08-函数.html" class="sidebar-link">08-函数</a></li><li><a href="/./guide/notes/jswork/09-案例.html" class="sidebar-link">09-案例</a></li><li><a href="/./guide/notes/jswork/10-数组.html" class="active sidebar-link">10-数组</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/./guide/notes/jswork/10-数组.html#_1-关于数组的描述-下列说法正确的是-选择两项" class="sidebar-link">1.关于数组的描述，下列说法正确的是？ （选择两项）</a></li><li class="sidebar-sub-header"><a href="/./guide/notes/jswork/10-数组.html#_2-创建数组的基本方式有两种-下列创建数组的方式错误的是-选择一项" class="sidebar-link">2.创建数组的基本方式有两种，下列创建数组的方式错误的是？（选择一项）</a></li><li class="sidebar-sub-header"><a href="/./guide/notes/jswork/10-数组.html#_3-下面这段代码运行结果是-选择一项" class="sidebar-link">3.下面这段代码运行结果是？（选择一项）</a></li><li class="sidebar-sub-header"><a href="/./guide/notes/jswork/10-数组.html#_4-下面这段代码运行结果是-选择一项" class="sidebar-link">4.下面这段代码运行结果是？（选择一项）</a></li><li class="sidebar-sub-header"><a href="/./guide/notes/jswork/10-数组.html#_5-下面这段代码运行结果是-选择一项" class="sidebar-link">5.下面这段代码运行结果是？（选择一项）</a></li><li class="sidebar-sub-header"><a href="/./guide/notes/jswork/10-数组.html#_6-下面这段代码运行结果是-选择一项" class="sidebar-link">6.下面这段代码运行结果是？（选择一项）</a></li><li class="sidebar-sub-header"><a href="/./guide/notes/jswork/10-数组.html#_7-下面代码的输出结果是-选择一项" class="sidebar-link">7.下面代码的输出结果是？（选择一项）</a></li><li class="sidebar-sub-header"><a href="/./guide/notes/jswork/10-数组.html#_8-关于数组的方法下列选项正确的是-选择两项" class="sidebar-link">8.关于数组的方法下列选项正确的是？（选择两项）</a></li><li class="sidebar-sub-header"><a href="/./guide/notes/jswork/10-数组.html#_9-代码的运行结果是-选择一项" class="sidebar-link">9.代码的运行结果是？（选择一项）</a></li><li class="sidebar-sub-header"><a href="/./guide/notes/jswork/10-数组.html#_10以下代码运行结果为-选择一项" class="sidebar-link">10以下代码运行结果为？（选择一项）</a></li><li class="sidebar-sub-header"><a href="/./guide/notes/jswork/10-数组.html#_11-关于数组的splice-方法-下列说法正确的是-选择两项" class="sidebar-link">11.关于数组的splice()方法，下列说法正确的是？（选择两项）</a></li><li class="sidebar-sub-header"><a href="/./guide/notes/jswork/10-数组.html#_12-下面代码运行结果是-选择一项" class="sidebar-link">12.下面代码运行结果是？（选择一项）</a></li><li class="sidebar-sub-header"><a href="/./guide/notes/jswork/10-数组.html#_13-下面代码运行结果是-选择一项" class="sidebar-link">13.下面代码运行结果是？（选择一项）</a></li><li class="sidebar-sub-header"><a href="/./guide/notes/jswork/10-数组.html#_14-下面代码运行结果是-选择一项" class="sidebar-link">14.下面代码运行结果是？（选择一项）</a></li><li class="sidebar-sub-header"><a href="/./guide/notes/jswork/10-数组.html#_15-以下代码中-需要使用数组的哪一个方法-可以让结果输出false-选择一项" class="sidebar-link">15.以下代码中，需要使用数组的哪一个方法，可以让结果输出false？(选择一项)</a></li><li class="sidebar-sub-header"><a href="/./guide/notes/jswork/10-数组.html#_16-下列代码运行结果是-选择一项" class="sidebar-link">16.下列代码运行结果是？（选择一项）</a></li><li class="sidebar-sub-header"><a href="/./guide/notes/jswork/10-数组.html#_17-下列代码运行结果是-选择一项" class="sidebar-link">17.下列代码运行结果是？（选择一项）</a></li><li class="sidebar-sub-header"><a href="/./guide/notes/jswork/10-数组.html#_18-代码的运行结果是-选择一项" class="sidebar-link">18.代码的运行结果是？（选择一项）</a></li><li class="sidebar-sub-header"><a href="/./guide/notes/jswork/10-数组.html#_19-下面代码运行结果是-选择一项" class="sidebar-link">19.下面代码运行结果是？（选择一项）</a></li><li class="sidebar-sub-header"><a href="/./guide/notes/jswork/10-数组.html#_20-以下选项中-说法正确的是-选择一项" class="sidebar-link">20.以下选项中，说法正确的是？（选择一项）</a></li><li class="sidebar-sub-header"><a href="/./guide/notes/jswork/10-数组.html#_21-以下程序的输出结果是什么-选择一项" class="sidebar-link">21.以下程序的输出结果是什么？（选择一项）</a></li><li class="sidebar-sub-header"><a href="/./guide/notes/jswork/10-数组.html#_22-编程练习" class="sidebar-link">22.编程练习</a></li></ul></li><li><a href="/./guide/notes/jswork/11-字符串.html" class="sidebar-link">11-字符串</a></li><li><a href="/./guide/notes/jswork/12-DOM.html" class="sidebar-link">12-DOM</a></li><li><a href="/./guide/notes/jswork/13-浏览器操作.html" class="sidebar-link">13-BOM</a></li><li><a href="/./guide/notes/jswork/14-面向project.html" class="sidebar-link">14-面向对象</a></li><li><a href="/./guide/notes/jswork/15-Js阶段测试组卷.html" class="sidebar-link">15-Js阶段测试组卷</a></li><li><a href="/./guide/notes/jswork/16-模板字符串箭头函数变量声明.html" class="sidebar-link">16-模板字符串箭头函数变量声明</a></li><li><a href="/./guide/notes/jswork/17-解构赋值.html" class="sidebar-link">17-解构赋值</a></li><li><a href="/./guide/notes/jswork/18-project字面量增强和函数默认参数.html" class="sidebar-link">18-对象字面量增强和函数默认参数</a></li><li><a href="/./guide/notes/jswork/19-剩余参数和数组展开.html" class="sidebar-link">19-剩余参数和数组展开</a></li><li><a href="/./guide/notes/jswork/20-Map Set.html" class="sidebar-link">20-Map Set</a></li><li><a href="/./guide/notes/jswork/21-iterator和for...of循环.html" class="sidebar-link">21-iterator和for...of循环</a></li><li><a href="/./guide/notes/jswork/22-Promise和class.html" class="sidebar-link">22-Promise和class</a></li><li><a href="/./guide/notes/jswork/23-module.html" class="sidebar-link">23-module</a></li><li><a href="/./guide/notes/jswork/24-ES6测评题目.html" class="sidebar-link">24-ES6测评题目</a></li><li><a href="/./guide/notes/jswork/25-本地存储和http.html" class="sidebar-link">25-本地存储和http</a></li><li><a href="/./guide/notes/jswork/26-ajax选择题.html" class="sidebar-link">26-ajax选择题</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h2 id="_1-关于数组的描述-下列说法正确的是-选择两项"><a href="#_1-关于数组的描述-下列说法正确的是-选择两项" class="header-anchor">#</a> 1.关于数组的描述，下列说法正确的是？ （选择两项）</h2> <p>**A.**数组可以用来保存一组不同类型的数据</p> <p>**B.**数组的length属性可以获得数组的长度</p> <p>**C.**数组的索引是从1开始的正整数</p> <p>**D.**使用（）获取数组的索引</p> <p>本题考查的是数组的概念和运用。</p> <p>数组可以用来保存一组不同类型的数据，A说法正确；</p> <p>数组的length属性可以获得数组的长度，B说法错误；</p> <p>数组的索引（下标）是从0开始的正整数，不是从1开始的，C说法错误；</p> <p>使用[ ]获取数组的索引，不是使用（）,D说法错误；</p> <p><strong>本题答案为AB。</strong></p> <h2 id="_2-创建数组的基本方式有两种-下列创建数组的方式错误的是-选择一项"><a href="#_2-创建数组的基本方式有两种-下列创建数组的方式错误的是-选择一项" class="header-anchor">#</a> 2.创建数组的基本方式有两种，下列创建数组的方式错误的是？（选择一项）</h2> <p>**A.**var arr=new Array(1);</p> <p>**B.**var arr=new array( );</p> <p>**C.**var arr=[ ];</p> <p>**D.**var arr=[ 1,2,&quot;3&quot;];</p> <p>参考解析：</p> <p>本题考查的是数组的创建方式。</p> <p>第一种方式是使用new Array（）构造函数，第二种是直接使用包含数组项的[ ]来表示。</p> <p>B中代码var arr=new array( )，其中array书写有误，正确书写为Array。所<strong>以本题答案为B</strong>。</p> <h2 id="_3-下面这段代码运行结果是-选择一项"><a href="#_3-下面这段代码运行结果是-选择一项" class="header-anchor">#</a> 3.下面这段代码运行结果是？（选择一项）</h2> <p><a href="https://imgchr.com/i/0fI39S" target="_blank" rel="noopener noreferrer"><img src="https://s1.ax1x.com/2020/10/13/0fI39S.png" alt="0fI39S.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p>**A.**控制台输出3和4</p> <p>**B.**控制台输出4和4</p> <p>**C.**控制台输出4和undefined</p> <p>**D.**控制台输出3和undefined</p> <p>本题考查的是定义数组和数组添加元素。</p> <p>本题代码中，使用了var arr=new Array(3)定义了一个数组arr，且数组的长度为3。虽然设置了长度为3，但是我们可以继续往数组中添加项，即arr[3]=4是往数组中，添加了第4个元素，数组的长度变为4，所以arr.length输出为4；而arr[0]=1，arr[1]=2，arr[2]=3则是更改数组前三项的内容。</p> <p>arr[4]是获取索引（下标）4的元素，但是这个数组的索引最大是3，索引为4的项没有定义，所以输出的是undefined。</p> <p><strong>本题答案为C。</strong></p> <h2 id="_4-下面这段代码运行结果是-选择一项"><a href="#_4-下面这段代码运行结果是-选择一项" class="header-anchor">#</a> 4.下面这段代码运行结果是？（选择一项）</h2> <p><a href="https://imgchr.com/i/0fIdA0" target="_blank" rel="noopener noreferrer"><img src="https://s1.ax1x.com/2020/10/13/0fIdA0.png" alt="0fIdA0.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><strong>A.</strong>[0, 2, 3, 4, 5, 0]</p> <p><strong>B.</strong>[1, 2, 3, 4, 5]</p> <p><strong>C.</strong>[0, 1, 2, 3, 4, 5, 0]</p> <p><strong>D.</strong>[0, 1, 2, 3, 4, 5,]</p> <p>本题考查数组中元素的添加与修改。</p> <p>数组可以通过索引（下标）的形式为数组添加元素，也可以通过索引的方式去修改当前数组的元素。</p> <p>数组的索引是从0开始，arr[0]=0是把数组的第一个元素1修改成0。数组arr中没有索引为5的元素，所以arr[5]=0是在数组索引为5的位置，添加了一个0。数组arr最终的结果为[0, 2, 3, 4, 5, 0]，<strong>本题答案为A。</strong></p> <h2 id="_5-下面这段代码运行结果是-选择一项"><a href="#_5-下面这段代码运行结果是-选择一项" class="header-anchor">#</a> 5.下面这段代码运行结果是？（选择一项）</h2> <p><a href="https://imgchr.com/i/0fIWAx" target="_blank" rel="noopener noreferrer"><img src="https://s1.ax1x.com/2020/10/13/0fIWAx.png" alt="0fIWAx.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p>**A.**控制台输出[1,&quot;hello&quot;,true]</p> <p>**B.**控制台输出[1,&quot;hello&quot;,false]</p> <p>**C.**控制台输出[1,&quot;hello&quot;,false,null,undefined]</p> <p>**D.**控制台输出[1,&quot;hello&quot;,true,null,undefined]</p> <p>本题考查数组中元素的添加与修改。</p> <p>数组可以通过索引（下标）的形式为数组添加项，也可以通过索引的方式去修改当前数组的项，而且数组里的数据可以是所有的数据类型。</p> <p>本题代码中，定义了一个数组arr，且数组默认有3个元素，即1、&quot;hello&quot;、true，相当于arr=[1,&quot;hello&quot;,true]。arr[2]=false是把数组中索引为2的元素true改为false。数组中没有定义索引为3和索引为4的元素，所以arr[3]=null和arr[4]=undefined，是在数组arr索引为3和索引为4的地方添加了两个元素。</p> <p>最终arr为[1,&quot;hello&quot;,false,null,undefined]，<strong>本题答案为C。</strong></p> <h2 id="_6-下面这段代码运行结果是-选择一项"><a href="#_6-下面这段代码运行结果是-选择一项" class="header-anchor">#</a> 6.下面这段代码运行结果是？（选择一项）</h2> <p><a href="https://imgchr.com/i/0foibn" target="_blank" rel="noopener noreferrer"><img src="https://s1.ax1x.com/2020/10/13/0foibn.png" alt="0foibn.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p>**A.**9</p> <p>**B.**10</p> <p>**C.**7</p> <p>**D.**5</p> <p>本题考查的是数组属性length的使用。</p> <p>arr.length是获取数组arr的长度。数组中元素的索引（下标）是从0开始的，计算数组的长度，就等于它的最后一项索引值加1。本题代码中，数组arr最后一个元素索引是9，所以这个数组的长度是10。</p> <p><strong>本题答案为B。</strong></p> <h2 id="_7-下面代码的输出结果是-选择一项"><a href="#_7-下面代码的输出结果是-选择一项" class="header-anchor">#</a> 7.下面代码的输出结果是？（选择一项）</h2> <p><a href="https://imgchr.com/i/0foyPf" target="_blank" rel="noopener noreferrer"><img src="https://s1.ax1x.com/2020/10/13/0foyPf.png" alt="0foyPf.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p>**A.**true，true，false</p> <p>**B.**true，true，true</p> <p>**C.**true，false，false</p> <p>**D.**false，true，false</p> <p><strong>本题考查isArray方法的使用</strong>。</p> <p>isArray检测一个变量是否为数组，如果是，则返回true。如果不是，则返回false。</p> <p>[null]是一个数组，&quot;[1,3]&quot;和null都不是数组。所以输出的结果依次为true，false，false，<strong>本题答案为C</strong></p> <h2 id="_8-关于数组的方法下列选项正确的是-选择两项"><a href="#_8-关于数组的方法下列选项正确的是-选择两项" class="header-anchor">#</a> 8.关于数组的方法下列选项正确的是？（选择两项）</h2> <p>**A.**push（）是把新的参数添加到数组的最前面，返回值是数组的新长度；</p> <p>**B.**unshift（）是把新的参数添加到数组的尾部，返回值是数组的新长度；</p> <p>**C.**pop（）是删除数组中的最后一个元素，返回值是被删除的那个元素；</p> <p>**D.**shift（）是删除数组中的第一个元素，返回值是被删除的那个元素；</p> <p><strong>本题考查的是数组相关的方法。</strong></p> <p>push（）是把新的参数添加到数组的尾部，返回值是数组的新长度，A说法错误；</p> <p>unshift（）是把新的参数添加到数组的最前面，返回值是数组的新长度，B说法错误；</p> <p>pop（）是删除数组中的最后一个元素，返回值是被删除的那个元素，C说法正确；</p> <p>shift（）是删除数组中的第一个元素，返回值是被删除的那个元素，D说法正确；</p> <p><strong>本题答案为CD。</strong></p> <h2 id="_9-代码的运行结果是-选择一项"><a href="#_9-代码的运行结果是-选择一项" class="header-anchor">#</a> 9.代码的运行结果是？（选择一项）</h2> <p><a href="https://imgchr.com/i/0fT3Lj" target="_blank" rel="noopener noreferrer"><img src="https://s1.ax1x.com/2020/10/13/0fT3Lj.png" alt="0fT3Lj.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><strong>A.</strong>[3,4,5]</p> <p><strong>B.</strong>[2,3,4,5]</p> <p><strong>C.</strong>[1,2,3]</p> <p><strong>D.</strong>[1,2,3,4]</p> <p><strong>本题考查的是数组的pop方法。</strong></p> <p>pop()是删除数组中的最后一个元素，返回值是被删除的那个元素；本题中使用了两次pop()，那么就从数组的末尾删除两个项。arr最终结果为[1,2,3]，<strong>本题答案为C。</strong></p> <h2 id="_10以下代码运行结果为-选择一项"><a href="#_10以下代码运行结果为-选择一项" class="header-anchor">#</a> 10以下代码运行结果为？（选择一项）</h2> <p><a href="https://imgchr.com/i/0f7nB9" target="_blank" rel="noopener noreferrer"><img src="https://s1.ax1x.com/2020/10/13/0f7nB9.png" alt="0f7nB9.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><strong>A.</strong>[0,9,10,1,2,3,4,5]</p> <p><strong>B.</strong>[0,1,2,3,4,5,9,10]</p> <p><strong>C.</strong>[1,2,3,4,5]</p> <p><strong>D.</strong>[0,2,3,4,5]</p> <p><strong>本题考查的是数组的相关方法。</strong></p> <p>push()是把新的参数添加到数组的尾部，把9和10放在数组的后面，数组是[1,2,3,4,5,9,10]</p> <p>shift()是删除数组中的第一个元素，数组是[2,3,4,5,9,10]</p> <p>pop()是删除数组中的最后一个元素，数组是[2,3,4,5,9]</p> <p>unshift()是把新的参数添加到数组的最前面，给数组的开头增加一个0，数组是[0,2,3,4,5,9]</p> <p>最后pop()把数组最后面的9再删除，数组最后结果是[0,2,3,4,5]</p> <p><strong>所以本题答案为D。</strong></p> <h2 id="_11-关于数组的splice-方法-下列说法正确的是-选择两项"><a href="#_11-关于数组的splice-方法-下列说法正确的是-选择两项" class="header-anchor">#</a> 11.关于数组的splice()方法，下列说法正确的是？（选择两项）</h2> <p>**A.**splice()可以删除数组项，插入数组项以及替换数组项</p> <p>**B.**splice(index，count)中的参数count是要删除的项目数量，如果设置为0，则不会删除任何项。</p> <p>**C.**splice(index,count)的两个参数都是可选的。</p> <p>**D.**splice(index,count,item1,item2)插入项从count处开始</p> <p><strong>本题考查的是数组的splice方法。</strong></p> <p>splice()可以删除数组项，插入数组项以及替换数组项，A说法正确；</p> <p>splice(index，count)中的参数count是要删除的项目数量，如果设置为0，则不会删除任何项，B说法正确；</p> <p>splice的删除方法有两个参数，第一个是index，它必须要有，第二个是count，可设置也可不设置，如果设置的话，那么删除的个数就是count所定的，如果不设置，那么删除从index开始的所有值。C中说两个参数都是可选的错误；</p> <p>splice(index,count,item1,item2)是数组的替换方法，在指定的index位置插入值，count是删除项的个数，item1和item2是要替换的数据。D中说插入项从count处开始错误。</p> <p><strong>所以本题答案为AB。</strong></p> <h2 id="_12-下面代码运行结果是-选择一项"><a href="#_12-下面代码运行结果是-选择一项" class="header-anchor">#</a> 12.下面代码运行结果是？（选择一项）</h2> <p><a href="https://imgchr.com/i/0f7h40" target="_blank" rel="noopener noreferrer"><img src="https://s1.ax1x.com/2020/10/13/0f7h40.png" alt="0f7h40.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><strong>A.</strong>[&quot;hello&quot;,&quot;world&quot;] ，[1,2,3,4,5,6,7]</p> <p><strong>B.</strong>[ ]，[1, &quot;hello&quot;,&quot;world&quot;,2,3,4,5,6,7]</p> <p><strong>C.</strong>[&quot;hello&quot;,&quot;world&quot;]，[1, &quot;hello&quot;,&quot;world&quot;,2,3,4,5,6,7]</p> <p><strong>D.</strong>[ ]，[1,2,3,4,5,6,7]</p> <p><strong>本题考查的是数组splice的插入方法。</strong></p> <p>splice(index,0,item1,item2)方法的第一个参数index是插入数组项的起始位置，0是表示不删除任何项，所以返回的是一个空数组；后面的数值表示插入的项，即把&quot;hello&quot;和&quot;world&quot;插入到索引为1和索引为2的位置。arr最终结果为[1, &quot;hello&quot;,&quot;world&quot;,2,3,4,5,6,7]，<strong>本题答案为B。</strong></p> <h2 id="_13-下面代码运行结果是-选择一项"><a href="#_13-下面代码运行结果是-选择一项" class="header-anchor">#</a> 13.下面代码运行结果是？（选择一项）</h2> <p><a href="https://imgchr.com/i/0fH3an" target="_blank" rel="noopener noreferrer"><img src="https://s1.ax1x.com/2020/10/13/0fH3an.png" alt="0fH3an.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><strong>A.</strong>[&quot;study&quot;]，[&quot;good&quot;,&quot;good&quot;,&quot;eat&quot;,&quot;day&quot;,&quot;day&quot;,&quot;up&quot;]</p> <p><strong>B.</strong>[&quot;eat&quot; ]，[&quot;good&quot;,&quot;good&quot;,&quot;eat&quot;,&quot;day&quot;,&quot;day&quot;,&quot;up&quot;]</p> <p><strong>C.</strong>[&quot;study&quot;]，[&quot;good&quot;,&quot;good&quot;,&quot;study&quot;,&quot;eat&quot;,&quot;day&quot;,&quot;up&quot;]</p> <p><strong>D.</strong>[&quot;eat&quot; ]，[&quot;good&quot;,&quot;good&quot;,&quot;study&quot;,&quot;eat&quot;,&quot;day&quot;,&quot;up&quot;]</p> <p><strong>本题考查的是数组splice的替换方法</strong>，正确选项为A。</p> <p>splice(index，count，item1，item2)方法的第一个参数index是替换数组项的起始位置，count表示要被替换的项的个数，item1和item2表示要替换的内容。另外，它返回的是被替换的内容。</p> <p>本题代码中，arr.splice(2,1,&quot;eat&quot;)表示从数组索引为2的位置开始替换，替换的个数为1，替换的内容为&quot;eat&quot;。所以数组中&quot;study&quot;被替换成&quot;eat&quot;。arr.splice(2,1,&quot;eat&quot;)返回的结果是&quot;study&quot;，数组替换之后的结果为[&quot;good&quot;,&quot;good&quot;,&quot;eat&quot;,&quot;day&quot;,&quot;day&quot;,&quot;up&quot;]。</p> <p><strong>本题答案为A。</strong></p> <h2 id="_14-下面代码运行结果是-选择一项"><a href="#_14-下面代码运行结果是-选择一项" class="header-anchor">#</a> 14.下面代码运行结果是？（选择一项）</h2> <p><a href="https://imgchr.com/i/0fbnF1" target="_blank" rel="noopener noreferrer"><img src="https://s1.ax1x.com/2020/10/13/0fbnF1.png" alt="0fbnF1.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><strong>A.</strong>[8]</p> <p><strong>B.</strong>[5,6,7,8,9]</p> <p><strong>C.</strong>[4,5,6,7,8]</p> <p><strong>D.</strong>[4,5,6,7,8,9]</p> <p><strong>本题考查的是数组的slice方法。</strong></p> <p>slice()是从已有的数组中返回选定的元素，原有的数组不会发生变化，返回值是一个新的数组，它有两个参数start和end。如果参数有负数，那么用数组的长度加上这个负数，得到的值就是这个位置的索引（下标）。注意，slice截取数组元素时，不包含结束位置（end）的元素。</p> <p>本题代码中，arr.slice(-6,9)第一个参数-6是负数，用数组长度9减去-6，得出的值为3，即开始位置索引为3。第二个参数为8，但是截取时不包含8，即截取到索引为7的位置。所以arr.slice(-6,9)返回的结果是[4,5,6,7,8]，<strong>本题答案为C。</strong></p> <h2 id="_15-以下代码中-需要使用数组的哪一个方法-可以让结果输出false-选择一项"><a href="#_15-以下代码中-需要使用数组的哪一个方法-可以让结果输出false-选择一项" class="header-anchor">#</a> 15.以下代码中，需要使用数组的哪一个方法，可以让结果输出false？(选择一项)</h2> <p><a href="https://imgchr.com/i/0fbDOg" target="_blank" rel="noopener noreferrer"><img src="https://s1.ax1x.com/2020/10/13/0fbDOg.png" alt="0fbDOg.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p>**A.**indexOf</p> <p>**B.**concat</p> <p>**C.**join</p> <p>**D.**includes</p> <p><strong>本题考查数组各方法的使用。</strong></p> <p>indexOf返回指定元素在数组中的位置，如果没有这个元素，则返回-1。</p> <p>concat 用于连接数组，返回的是连接后的数组。</p> <p>join 是把数组中的元素拼接成字符串，返回的是字符串。</p> <p>includes 是检测数组中是否包含某一个元素，如果没有，则返回false。这里代码中不包含0，所以会返回false**，本题答案为D。**</p> <h2 id="_16-下列代码运行结果是-选择一项"><a href="#_16-下列代码运行结果是-选择一项" class="header-anchor">#</a> 16.下列代码运行结果是？（选择一项）</h2> <p><a href="https://imgchr.com/i/0fq390" target="_blank" rel="noopener noreferrer"><img src="https://s1.ax1x.com/2020/10/13/0fq390.png" alt="0fq390.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p>**A.**1;2;3;4;5;6，number，[1,2,3,4,5,6]</p> <p>**B.**1;2;3;4;5;6，number，[1;2;3;4;5;6]</p> <p>**C.**1;2;3;4;5;6，string，[1;2;3;4;5;6]</p> <p>**D.**1;2;3;4;5;6，string，[1,2,3,4,5,6]</p> <p><strong>本题考察的是数组的join（）方法</strong>。</p> <p>join（）方法用于把数组中的所有元素变成一个字符串，并通过指定的分隔符进行分隔，返回的不是数组，而是一个字符串，且不会改变原数组。</p> <p>本题代码中，arr.join(&quot;;&quot;)通过分号把数组arr分割成字符串，结果为&quot;1;2;3;4;5;6&quot;。返回的结果赋值给了str，所以str通过typeof检测类型输出为&quot;string&quot;。原数组arr不会改变，依旧为string，[1,2,3,4,5,6]。</p> <p><strong>本题答案为D。</strong></p> <h2 id="_17-下列代码运行结果是-选择一项"><a href="#_17-下列代码运行结果是-选择一项" class="header-anchor">#</a> 17.下列代码运行结果是？（选择一项）</h2> <p><a href="https://imgchr.com/i/0fqI8P" target="_blank" rel="noopener noreferrer"><img src="https://s1.ax1x.com/2020/10/13/0fqI8P.png" alt="0fqI8P.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><strong>A.</strong>[-9,0,3,4,12,35]</p> <p><strong>B.</strong>[0,35,-9,3,4,12]</p> <p><strong>C.</strong>[35,12,4,3,0,-9]</p> <p><strong>D.</strong>[0,12,3,35,4,-9]</p> <p><strong>本题考查的是数组的reverse（）方法。</strong></p> <p>reverse（）方法用于颠倒数组中元素的顺序，不会进行排序。所以本题代码中，数组arr颠倒顺序后，结果为[0,35,-9,3,4,12]，<strong>本题答案为B</strong>。</p> <h2 id="_18-代码的运行结果是-选择一项"><a href="#_18-代码的运行结果是-选择一项" class="header-anchor">#</a> 18.代码的运行结果是？（选择一项）</h2> <p><a href="https://imgchr.com/i/0fLib4" target="_blank" rel="noopener noreferrer"><img src="https://s1.ax1x.com/2020/10/13/0fLib4.png" alt="0fLib4.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><strong>A.</strong>[&quot;hello&quot;,&quot;world&quot;];</p> <p><strong>B.</strong>[1,2,3,4,5,6];</p> <p><strong>C.</strong>[1,2,3,4,5,6, &quot;hello&quot;,&quot;world&quot;];</p> <p><strong>D.</strong>[ ]</p> <p><strong>本题考查的是数组的concat方法。</strong></p> <p>concat()方法用于连接两个或多个数组，返回值是一个新结合的数组，并且不会改变原数组。</p> <p>本题代码中，是把arr1和arr2合并成一个新数组，并赋值给了arr。但是原数组arr1和arr2并不会改变，所以输出arr1结果为[1,2,3,4,5,6]，<strong>本题答案为B。</strong></p> <h2 id="_19-下面代码运行结果是-选择一项"><a href="#_19-下面代码运行结果是-选择一项" class="header-anchor">#</a> 19.下面代码运行结果是？（选择一项）</h2> <p><a href="https://imgchr.com/i/0fLrIs" target="_blank" rel="noopener noreferrer"><img src="https://s1.ax1x.com/2020/10/13/0fLrIs.png" alt="0fLrIs.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p>**A.**2</p> <p><strong>B.</strong>-1</p> <p>**C.**5</p> <p>**D.**0</p> <p><strong>本题考查的是数组indexOf()的方法。</strong></p> <p>indexOf()有两个参数，第一个参数是要查找的项，第二个是查找项的起点位置的索引。如果查找到该项，则返回它从查找位置起，首次出现的位置。如果没有查找到，则返回-1。</p> <p>本题代码中，arr.indexOf(3,6)意思是从数组arr索引（下标）为6的位置开始查找数字3。这个数组没有索引为6的项，所以返回-1。</p> <p><strong>本题答案为B。</strong></p> <h2 id="_20-以下选项中-说法正确的是-选择一项"><a href="#_20-以下选项中-说法正确的是-选择一项" class="header-anchor">#</a> 20.以下选项中，说法正确的是？（选择一项）</h2> <p><strong>A.</strong>[]==[]比较的结果为true</p> <p>**B.**null==null 比较结果为true</p> <p>**C.**undefined==undefined比较结果为false</p> <p>**D.**false==false比较结果为false</p> <p><strong>本题考查基本类型和引用类型的比较。</strong></p> <p>基本类型比较值是否相同，引用类型比较内存地址是否相同。</p> <p>[]==[]： 两个空数组指向的内存地址不一样，比较结果为false。A说法错误。</p> <p>null==null：null为基本类型，比较结果为true。B说法正确。</p> <p>undefined==undefined ：undefined 为基本类型，比较结果为true。C说法错误。</p> <p>false==false ：false为基本类型，比较结果为true。D说法错误。</p> <p><strong>所以本题答案为B。</strong></p> <h2 id="_21-以下程序的输出结果是什么-选择一项"><a href="#_21-以下程序的输出结果是什么-选择一项" class="header-anchor">#</a> 21.以下程序的输出结果是什么？（选择一项）</h2> <p><a href="https://imgchr.com/i/0hSAO0" target="_blank" rel="noopener noreferrer"><img src="https://s1.ax1x.com/2020/10/13/0hSAO0.png" alt="0hSAO0.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><strong>A.</strong>[1,[2,3]]</p> <p><strong>B.</strong> [2,3]</p> <p><strong>C.</strong> [2,3,4]</p> <p><strong>D.</strong>[1,[2,3,4]]</p> <p><strong>本题主要考查浅克隆的理解和运用。</strong></p> <p>var arr2=[arr1[0],arr1[1]] 中，并没有直接把arr1赋值给arr2, 它们两个指向的内存地址不一样，所以给arr1添加或者删除元素不会影响到arr2。</p> <p>但arr2中的元素，是直接复制arr1中的元素。由于arr1[1]是引用类型, 故arr1[1]==arr2[1]，那么在arr1[1]删除或者添加元素会影响到arr2的结果。</p> <p><strong>所以本题答案为D。</strong></p> <h2 id="_22-编程练习"><a href="#_22-编程练习" class="header-anchor">#</a> 22.编程练习</h2> <p><a href="https://imgchr.com/i/0h9Qqx" target="_blank" rel="noopener noreferrer"><img src="https://s1.ax1x.com/2020/10/13/0h9Qqx.gif" alt="0h9Qqx.gif"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <div class="language-html line-numbers-mode"><pre class="language-html"><code><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>style</span><span class="token punctuation">&gt;</span></span><span class="token style"><span class="token language-css">
    <span class="token selector">*</span> <span class="token punctuation">{</span>
        <span class="token property">margin</span><span class="token punctuation">:</span> 0<span class="token punctuation">;</span>
        <span class="token property">padding</span><span class="token punctuation">:</span> 0<span class="token punctuation">;</span>
        <span class="token property">user-select</span><span class="token punctuation">:</span> none<span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
    <span class="token selector">ul</span> <span class="token punctuation">{</span>
        <span class="token property">list-style</span><span class="token punctuation">:</span> none<span class="token punctuation">;</span>
    <span class="token punctuation">}</span>

    <span class="token selector">#wrap</span> <span class="token punctuation">{</span>
        <span class="token property">width</span><span class="token punctuation">:</span> 300px<span class="token punctuation">;</span>
        <span class="token property">padding</span><span class="token punctuation">:</span> 15px 0<span class="token punctuation">;</span>
        <span class="token property">border</span><span class="token punctuation">:</span> 1px solid black<span class="token punctuation">;</span>
        <span class="token property">border-radius</span><span class="token punctuation">:</span> 20px<span class="token punctuation">;</span>
        <span class="token property">margin</span><span class="token punctuation">:</span> 100px auto 0<span class="token punctuation">;</span>
    <span class="token punctuation">}</span>

    <span class="token selector">#wrap ul li</span> <span class="token punctuation">{</span>
        <span class="token property">line-height</span><span class="token punctuation">:</span> 50px<span class="token punctuation">;</span>
        <span class="token property">text-indent</span><span class="token punctuation">:</span> 40px<span class="token punctuation">;</span>
        <span class="token property">cursor</span><span class="token punctuation">:</span> pointer<span class="token punctuation">;</span>
        <span class="token property">background</span><span class="token punctuation">:</span> <span class="token url"><span class="token function">url</span><span class="token punctuation">(</span>https://s1.ax1x.com/2020/09/26/0iBW26.jpg<span class="token punctuation">)</span></span> no-repeat
            20px center<span class="token punctuation">;</span>
    <span class="token punctuation">}</span>

    <span class="token selector">#wrap ul li.checked</span> <span class="token punctuation">{</span>
        <span class="token property">background</span><span class="token punctuation">:</span> <span class="token url"><span class="token function">url</span><span class="token punctuation">(</span>https://s1.ax1x.com/2020/09/26/0iBIqe.jpg<span class="token punctuation">)</span></span> no-repeat
            20px center<span class="token punctuation">;</span>
    <span class="token punctuation">}</span>

    <span class="token selector">#wrap ul li:nth-child(4n + 1)</span> <span class="token punctuation">{</span>
        <span class="token property">background-color</span><span class="token punctuation">:</span> #000<span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
    <span class="token selector">#wrap ul li:nth-child(4n + 2)</span> <span class="token punctuation">{</span>
        <span class="token property">background-color</span><span class="token punctuation">:</span> #333<span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
    <span class="token selector">#wrap ul li:nth-child(4n + 3)</span> <span class="token punctuation">{</span>
        <span class="token property">background-color</span><span class="token punctuation">:</span> #666<span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
    <span class="token selector">#wrap ul li:nth-child(4n + 4)</span> <span class="token punctuation">{</span>
        <span class="token property">background-color</span><span class="token punctuation">:</span> #999<span class="token punctuation">;</span>
    <span class="token punctuation">}</span>

    <span class="token selector">#wrap ul li span</span> <span class="token punctuation">{</span>
        <span class="token property">color</span><span class="token punctuation">:</span> #fff<span class="token punctuation">;</span>
        <span class="token property">font-size</span><span class="token punctuation">:</span> 16px<span class="token punctuation">;</span>
        <span class="token property">margin-left</span><span class="token punctuation">:</span> 40px<span class="token punctuation">;</span>
    <span class="token punctuation">}</span>

    <span class="token selector">#wrap .btn</span> <span class="token punctuation">{</span>
        <span class="token property">display</span><span class="token punctuation">:</span> flex<span class="token punctuation">;</span>
        <span class="token property">justify-content</span><span class="token punctuation">:</span> space-evenly<span class="token punctuation">;</span>
        <span class="token comment">/*height: 60px;*/</span>
        <span class="token property">line-height</span><span class="token punctuation">:</span> 60px<span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
    <span class="token selector">#wrap .btn div:not(.reverse)</span> <span class="token punctuation">{</span>
        <span class="token property">cursor</span><span class="token punctuation">:</span> pointer<span class="token punctuation">;</span>
        <span class="token property">display</span><span class="token punctuation">:</span> flex<span class="token punctuation">;</span>
        <span class="token property">justify-content</span><span class="token punctuation">:</span> center<span class="token punctuation">;</span>
        <span class="token property">flex</span><span class="token punctuation">:</span> 0.35<span class="token punctuation">;</span>

        <span class="token property">background</span><span class="token punctuation">:</span> <span class="token url"><span class="token function">url</span><span class="token punctuation">(</span>https://s1.ax1x.com/2020/09/26/0iBW26.jpg<span class="token punctuation">)</span></span> no-repeat
            right center<span class="token punctuation">;</span>
    <span class="token punctuation">}</span>

    <span class="token selector">#wrap .btn div.checked</span> <span class="token punctuation">{</span>
        <span class="token property">background</span><span class="token punctuation">:</span> <span class="token url"><span class="token function">url</span><span class="token punctuation">(</span>https://s1.ax1x.com/2020/09/26/0iBIqe.jpg<span class="token punctuation">)</span></span> no-repeat
            right center<span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>style</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>head</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>body</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>wrap<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>ul</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>li</span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>span</span><span class="token punctuation">&gt;</span></span>云牧<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>span</span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>li</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>li</span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>span</span><span class="token punctuation">&gt;</span></span>云牧<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>span</span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>li</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>li</span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>span</span><span class="token punctuation">&gt;</span></span>云牧<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>span</span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>li</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>li</span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>span</span><span class="token punctuation">&gt;</span></span>云牧<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>span</span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>li</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>li</span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>span</span><span class="token punctuation">&gt;</span></span>云牧<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>span</span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>li</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>li</span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>span</span><span class="token punctuation">&gt;</span></span>云牧<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>span</span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>li</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>li</span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>span</span><span class="token punctuation">&gt;</span></span>云牧<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>span</span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>li</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>li</span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>span</span><span class="token punctuation">&gt;</span></span>云牧<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>span</span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>li</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>ul</span><span class="token punctuation">&gt;</span></span>

        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>btn<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>all<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>全选<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>noAll checked<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>全不选<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>reverse<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>反选<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>

    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>script</span><span class="token punctuation">&gt;</span></span><span class="token script"><span class="token language-javascript">
        <span class="token keyword">let</span> aLi <span class="token operator">=</span> document<span class="token punctuation">.</span><span class="token function">querySelectorAll</span><span class="token punctuation">(</span><span class="token string">&quot;#wrap ul li&quot;</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
            oAll <span class="token operator">=</span> document<span class="token punctuation">.</span><span class="token function">querySelector</span><span class="token punctuation">(</span><span class="token string">&quot;#wrap .all&quot;</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
            oNoAll <span class="token operator">=</span> document<span class="token punctuation">.</span><span class="token function">querySelector</span><span class="token punctuation">(</span><span class="token string">&quot;#wrap .noAll&quot;</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
            oReverse <span class="token operator">=</span> document<span class="token punctuation">.</span><span class="token function">querySelector</span><span class="token punctuation">(</span><span class="token string">&quot;#wrap .reverse&quot;</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
            count <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>

        <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> aLi<span class="token punctuation">.</span>length<span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            aLi<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>mark <span class="token operator">=</span> <span class="token boolean">false</span><span class="token punctuation">;</span>

            aLi<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function-variable function">onclick</span> <span class="token operator">=</span> <span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
                <span class="token keyword">if</span> <span class="token punctuation">(</span>aLi<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>mark<span class="token punctuation">)</span> <span class="token punctuation">{</span>
                    <span class="token comment">//aLi[i].classList.remove(&quot;checked&quot;);</span>
                    <span class="token comment">//aLi[i].mark = false;</span>
                    count<span class="token operator">--</span><span class="token punctuation">;</span>
                <span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{</span>
                    <span class="token comment">//aLi[i].classList.add(&quot;checked&quot;);</span>
                    <span class="token comment">//aLi[i].mark = true;</span>
                    count<span class="token operator">++</span><span class="token punctuation">;</span>
                <span class="token punctuation">}</span>

                aLi<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>classList<span class="token punctuation">.</span><span class="token function">toggle</span><span class="token punctuation">(</span><span class="token string">&quot;checked&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                aLi<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>mark <span class="token operator">=</span> <span class="token operator">!</span>aLi<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>mark<span class="token punctuation">;</span>
                console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span>count<span class="token punctuation">)</span><span class="token punctuation">;</span>

                <span class="token function">isNum</span><span class="token punctuation">(</span>count<span class="token punctuation">)</span><span class="token punctuation">;</span>
                <span class="token comment">//  switch (count) {</span>
                <span class="token comment">//    case aLi.length:</span>
                <span class="token comment">//      oAll.classList.add(&quot;checked&quot;);</span>
                <span class="token comment">//      oNoAll.classList.remove(&quot;checked&quot;);</span>
                <span class="token comment">//      oReverse.classList.remove(&quot;checked&quot;);</span>
                <span class="token comment">//      break;</span>

                <span class="token comment">//    case 0:</span>
                <span class="token comment">//      oAll.classList.remove(&quot;checked&quot;);</span>
                <span class="token comment">//      oNoAll.classList.add(&quot;checked&quot;);</span>
                <span class="token comment">//      oReverse.classList.remove(&quot;checked&quot;);</span>
                <span class="token comment">//      break;</span>

                <span class="token comment">//    default:</span>
                <span class="token comment">//      oAll.classList.remove(&quot;checked&quot;);</span>
                <span class="token comment">//      oNoAll.classList.remove(&quot;checked&quot;);</span>
                <span class="token comment">//      oReverse.classList.remove(&quot;checked&quot;);</span>
                <span class="token comment">//      break;</span>
                <span class="token comment">//  }</span>
            <span class="token punctuation">}</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>

        oAll<span class="token punctuation">.</span><span class="token function-variable function">onclick</span> <span class="token operator">=</span> <span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> aLi<span class="token punctuation">.</span>length<span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
                aLi<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>classList<span class="token punctuation">.</span><span class="token function">add</span><span class="token punctuation">(</span><span class="token string">&quot;checked&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                aLi<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>mark <span class="token operator">=</span> <span class="token boolean">true</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span>

            count <span class="token operator">=</span> aLi<span class="token punctuation">.</span>length<span class="token punctuation">;</span>

            <span class="token function">isNum</span><span class="token punctuation">(</span>count<span class="token punctuation">)</span><span class="token punctuation">;</span>

            <span class="token comment">//switch (count) {</span>
            <span class="token comment">//  case aLi.length:</span>
            <span class="token comment">//    oAll.classList.add(&quot;checked&quot;);</span>
            <span class="token comment">//    oNoAll.classList.remove(&quot;checked&quot;);</span>

            <span class="token comment">//    break;</span>

            <span class="token comment">//  case 0:</span>
            <span class="token comment">//    oAll.classList.remove(&quot;checked&quot;);</span>
            <span class="token comment">//    oNoAll.classList.add(&quot;checked&quot;);</span>

            <span class="token comment">//    break;</span>

            <span class="token comment">//  default:</span>
            <span class="token comment">//    oAll.classList.remove(&quot;checked&quot;);</span>
            <span class="token comment">//    oNoAll.classList.remove(&quot;checked&quot;);</span>

            <span class="token comment">//    break;</span>
            <span class="token comment">//}</span>
        <span class="token punctuation">}</span><span class="token punctuation">;</span>

        oNoAll<span class="token punctuation">.</span><span class="token function-variable function">onclick</span> <span class="token operator">=</span> <span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> aLi<span class="token punctuation">.</span>length<span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
                aLi<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>classList<span class="token punctuation">.</span><span class="token function">remove</span><span class="token punctuation">(</span><span class="token string">&quot;checked&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                aLi<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>mark <span class="token operator">=</span> <span class="token boolean">false</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span>

            count <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>

            <span class="token function">isNum</span><span class="token punctuation">(</span>count<span class="token punctuation">)</span><span class="token punctuation">;</span>

            <span class="token comment">//switch (count) {</span>
            <span class="token comment">//  case aLi.length:</span>
            <span class="token comment">//    oAll.classList.add(&quot;checked&quot;);</span>
            <span class="token comment">//    oNoAll.classList.remove(&quot;checked&quot;);</span>

            <span class="token comment">//    break;</span>

            <span class="token comment">//  case 0:</span>
            <span class="token comment">//    oAll.classList.remove(&quot;checked&quot;);</span>
            <span class="token comment">//    oNoAll.classList.add(&quot;checked&quot;);</span>

            <span class="token comment">//    break;</span>

            <span class="token comment">//  default:</span>
            <span class="token comment">//    oAll.classList.remove(&quot;checked&quot;);</span>
            <span class="token comment">//    oNoAll.classList.remove(&quot;checked&quot;);</span>

            <span class="token comment">//    break;</span>
            <span class="token comment">//}</span>
        <span class="token punctuation">}</span><span class="token punctuation">;</span>

        oReverse<span class="token punctuation">.</span><span class="token function-variable function">onclick</span> <span class="token operator">=</span> <span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> aLi<span class="token punctuation">.</span>length<span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>


                <span class="token comment">//console.log(count);</span>

                aLi<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>classList<span class="token punctuation">.</span><span class="token function">toggle</span><span class="token punctuation">(</span><span class="token string">&quot;checked&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>



                <span class="token keyword">if</span> <span class="token punctuation">(</span>aLi<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>mark<span class="token punctuation">)</span> <span class="token punctuation">{</span>
                    <span class="token comment">//aLi[i].mark = !aLi[i].mark;</span>
                    <span class="token comment">//aLi[i].classList.remove(&quot;checked&quot;);</span>
                    count<span class="token operator">--</span><span class="token punctuation">;</span>
                <span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{</span>
                    <span class="token comment">//aLi[i].mark = !aLi[i].mark;</span>
                    <span class="token comment">//aLi[i].classList.add(&quot;checked&quot;);</span>
                    count<span class="token operator">++</span><span class="token punctuation">;</span>
                <span class="token punctuation">}</span>
                aLi<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>mark <span class="token operator">=</span> <span class="token operator">!</span>aLi<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>mark<span class="token punctuation">;</span>
            <span class="token punctuation">}</span> 

            <span class="token function">isNum</span><span class="token punctuation">(</span>count<span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token comment">//switch (count) {</span>
            <span class="token comment">//  case aLi.length:</span>
            <span class="token comment">//    oAll.classList.add(&quot;checked&quot;);</span>
            <span class="token comment">//    oNoAll.classList.remove(&quot;checked&quot;);</span>
            <span class="token comment">//    break;</span>
            <span class="token comment">//  case 0:</span>
            <span class="token comment">//    oAll.classList.remove(&quot;checked&quot;);</span>
            <span class="token comment">//    oNoAll.classList.add(&quot;checked&quot;);</span>
            <span class="token comment">//    break;</span>
            <span class="token comment">//  default:</span>
            <span class="token comment">//    oAll.classList.remove(&quot;checked&quot;);</span>
            <span class="token comment">//    oNoAll.classList.remove(&quot;checked&quot;);</span>
            <span class="token comment">//    break;</span>
            <span class="token comment">//}</span>

        <span class="token punctuation">}</span><span class="token punctuation">;</span>

        <span class="token keyword">function</span> <span class="token function">isNum</span><span class="token punctuation">(</span><span class="token parameter">n</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            <span class="token keyword">switch</span> <span class="token punctuation">(</span>n<span class="token punctuation">)</span> <span class="token punctuation">{</span>
                <span class="token keyword">case</span> aLi<span class="token punctuation">.</span>length<span class="token operator">:</span>
                    oAll<span class="token punctuation">.</span>classList<span class="token punctuation">.</span><span class="token function">add</span><span class="token punctuation">(</span><span class="token string">&quot;checked&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                    oNoAll<span class="token punctuation">.</span>classList<span class="token punctuation">.</span><span class="token function">remove</span><span class="token punctuation">(</span><span class="token string">&quot;checked&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                    <span class="token keyword">break</span><span class="token punctuation">;</span>
                <span class="token keyword">case</span> <span class="token number">0</span><span class="token operator">:</span>
                    oAll<span class="token punctuation">.</span>classList<span class="token punctuation">.</span><span class="token function">remove</span><span class="token punctuation">(</span><span class="token string">&quot;checked&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                    oNoAll<span class="token punctuation">.</span>classList<span class="token punctuation">.</span><span class="token function">add</span><span class="token punctuation">(</span><span class="token string">&quot;checked&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                    <span class="token keyword">break</span><span class="token punctuation">;</span>
                <span class="token keyword">default</span><span class="token operator">:</span>
                    oAll<span class="token punctuation">.</span>classList<span class="token punctuation">.</span><span class="token function">remove</span><span class="token punctuation">(</span><span class="token string">&quot;checked&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                    oNoAll<span class="token punctuation">.</span>classList<span class="token punctuation">.</span><span class="token function">remove</span><span class="token punctuation">(</span><span class="token string">&quot;checked&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                    <span class="token keyword">break</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
        <span class="token punctuation">}</span>
    </span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>script</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>body</span><span class="token punctuation">&gt;</span></span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br><span class="line-number">48</span><br><span class="line-number">49</span><br><span class="line-number">50</span><br><span class="line-number">51</span><br><span class="line-number">52</span><br><span class="line-number">53</span><br><span class="line-number">54</span><br><span class="line-number">55</span><br><span class="line-number">56</span><br><span class="line-number">57</span><br><span class="line-number">58</span><br><span class="line-number">59</span><br><span class="line-number">60</span><br><span class="line-number">61</span><br><span class="line-number">62</span><br><span class="line-number">63</span><br><span class="line-number">64</span><br><span class="line-number">65</span><br><span class="line-number">66</span><br><span class="line-number">67</span><br><span class="line-number">68</span><br><span class="line-number">69</span><br><span class="line-number">70</span><br><span class="line-number">71</span><br><span class="line-number">72</span><br><span class="line-number">73</span><br><span class="line-number">74</span><br><span class="line-number">75</span><br><span class="line-number">76</span><br><span class="line-number">77</span><br><span class="line-number">78</span><br><span class="line-number">79</span><br><span class="line-number">80</span><br><span class="line-number">81</span><br><span class="line-number">82</span><br><span class="line-number">83</span><br><span class="line-number">84</span><br><span class="line-number">85</span><br><span class="line-number">86</span><br><span class="line-number">87</span><br><span class="line-number">88</span><br><span class="line-number">89</span><br><span class="line-number">90</span><br><span class="line-number">91</span><br><span class="line-number">92</span><br><span class="line-number">93</span><br><span class="line-number">94</span><br><span class="line-number">95</span><br><span class="line-number">96</span><br><span class="line-number">97</span><br><span class="line-number">98</span><br><span class="line-number">99</span><br><span class="line-number">100</span><br><span class="line-number">101</span><br><span class="line-number">102</span><br><span class="line-number">103</span><br><span class="line-number">104</span><br><span class="line-number">105</span><br><span class="line-number">106</span><br><span class="line-number">107</span><br><span class="line-number">108</span><br><span class="line-number">109</span><br><span class="line-number">110</span><br><span class="line-number">111</span><br><span class="line-number">112</span><br><span class="line-number">113</span><br><span class="line-number">114</span><br><span class="line-number">115</span><br><span class="line-number">116</span><br><span class="line-number">117</span><br><span class="line-number">118</span><br><span class="line-number">119</span><br><span class="line-number">120</span><br><span class="line-number">121</span><br><span class="line-number">122</span><br><span class="line-number">123</span><br><span class="line-number">124</span><br><span class="line-number">125</span><br><span class="line-number">126</span><br><span class="line-number">127</span><br><span class="line-number">128</span><br><span class="line-number">129</span><br><span class="line-number">130</span><br><span class="line-number">131</span><br><span class="line-number">132</span><br><span class="line-number">133</span><br><span class="line-number">134</span><br><span class="line-number">135</span><br><span class="line-number">136</span><br><span class="line-number">137</span><br><span class="line-number">138</span><br><span class="line-number">139</span><br><span class="line-number">140</span><br><span class="line-number">141</span><br><span class="line-number">142</span><br><span class="line-number">143</span><br><span class="line-number">144</span><br><span class="line-number">145</span><br><span class="line-number">146</span><br><span class="line-number">147</span><br><span class="line-number">148</span><br><span class="line-number">149</span><br><span class="line-number">150</span><br><span class="line-number">151</span><br><span class="line-number">152</span><br><span class="line-number">153</span><br><span class="line-number">154</span><br><span class="line-number">155</span><br><span class="line-number">156</span><br><span class="line-number">157</span><br><span class="line-number">158</span><br><span class="line-number">159</span><br><span class="line-number">160</span><br><span class="line-number">161</span><br><span class="line-number">162</span><br><span class="line-number">163</span><br><span class="line-number">164</span><br><span class="line-number">165</span><br><span class="line-number">166</span><br><span class="line-number">167</span><br><span class="line-number">168</span><br><span class="line-number">169</span><br><span class="line-number">170</span><br><span class="line-number">171</span><br><span class="line-number">172</span><br><span class="line-number">173</span><br><span class="line-number">174</span><br><span class="line-number">175</span><br><span class="line-number">176</span><br><span class="line-number">177</span><br><span class="line-number">178</span><br><span class="line-number">179</span><br><span class="line-number">180</span><br><span class="line-number">181</span><br><span class="line-number">182</span><br><span class="line-number">183</span><br><span class="line-number">184</span><br><span class="line-number">185</span><br><span class="line-number">186</span><br><span class="line-number">187</span><br><span class="line-number">188</span><br><span class="line-number">189</span><br><span class="line-number">190</span><br><span class="line-number">191</span><br><span class="line-number">192</span><br><span class="line-number">193</span><br><span class="line-number">194</span><br><span class="line-number">195</span><br><span class="line-number">196</span><br><span class="line-number">197</span><br><span class="line-number">198</span><br><span class="line-number">199</span><br><span class="line-number">200</span><br><span class="line-number">201</span><br><span class="line-number">202</span><br><span class="line-number">203</span><br><span class="line-number">204</span><br><span class="line-number">205</span><br><span class="line-number">206</span><br><span class="line-number">207</span><br><span class="line-number">208</span><br><span class="line-number">209</span><br><span class="line-number">210</span><br><span class="line-number">211</span><br><span class="line-number">212</span><br><span class="line-number">213</span><br><span class="line-number">214</span><br><span class="line-number">215</span><br><span class="line-number">216</span><br><span class="line-number">217</span><br><span class="line-number">218</span><br><span class="line-number">219</span><br><span class="line-number">220</span><br><span class="line-number">221</span><br><span class="line-number">222</span><br><span class="line-number">223</span><br><span class="line-number">224</span><br><span class="line-number">225</span><br><span class="line-number">226</span><br><span class="line-number">227</span><br><span class="line-number">228</span><br><span class="line-number">229</span><br><span class="line-number">230</span><br><span class="line-number">231</span><br><span class="line-number">232</span><br><span class="line-number">233</span><br><span class="line-number">234</span><br><span class="line-number">235</span><br><span class="line-number">236</span><br><span class="line-number">237</span><br><span class="line-number">238</span><br><span class="line-number">239</span><br><span class="line-number">240</span><br><span class="line-number">241</span><br><span class="line-number">242</span><br><span class="line-number">243</span><br><span class="line-number">244</span><br><span class="line-number">245</span><br><span class="line-number">246</span><br><span class="line-number">247</span><br><span class="line-number">248</span><br><span class="line-number">249</span><br><span class="line-number">250</span><br><span class="line-number">251</span><br><span class="line-number">252</span><br><span class="line-number">253</span><br><span class="line-number">254</span><br><span class="line-number">255</span><br><span class="line-number">256</span><br><span class="line-number">257</span><br><span class="line-number">258</span><br><span class="line-number">259</span><br><span class="line-number">260</span><br></div></div></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
      ←
      <a href="/./guide/notes/jswork/09-案例.html" class="prev">
        09-案例
      </a></span> <span class="next"><a href="/./guide/notes/jswork/11-字符串.html">
        11-字符串
      </a>
      →
    </span></p></div> </main></div><div class="global-ui"><!----><div class="reco-bgm-panel" data-v-b1d3339e><audio id="bgm" src="https://www.ytmp3.cn/down/75475.mp3" data-v-b1d3339e></audio> <div class="reco-float-box" style="bottom:30px;z-index:999999;display:none;" data-v-b1d3339e data-v-41bcba48 data-v-b1d3339e><img src="https://p1.music.126.net/qTSIZ27qiFvRoKj-P30BiA==/109951165895951287.jpg?param=200y200" data-v-b1d3339e></div> <div class="reco-bgm-box" style="left:10px;bottom:10px;z-index:999999;" data-v-b1d3339e data-v-41bcba48 data-v-b1d3339e><div class="reco-bgm-cover" style="background-image:url(https://p1.music.126.net/qTSIZ27qiFvRoKj-P30BiA==/109951165895951287.jpg?param=200y200);" data-v-b1d3339e><div class="mini-operation" style="display:none;" data-v-b1d3339e><i class="reco-bgm reco-bgm-pause" style="display:none;" data-v-b1d3339e></i> <i class="reco-bgm reco-bgm-play" style="display:none;" data-v-b1d3339e></i></div> <div class="falut-message" style="display:none;" data-v-b1d3339e>
          播放失败
        </div></div> <div class="reco-bgm-info" data-v-b1d3339e data-v-41bcba48 data-v-b1d3339e><div class="info-box" data-v-b1d3339e><i class="reco-bgm reco-bgm-music music" data-v-b1d3339e></i>花花公子</div> <div class="info-box" data-v-b1d3339e><i class="reco-bgm reco-bgm-artist" data-v-b1d3339e></i>马思唯/step.jad</div> <div class="reco-bgm-progress" data-v-b1d3339e><div class="progress-bar" data-v-b1d3339e><div class="bar" data-v-b1d3339e></div></div></div> <div class="reco-bgm-operation" data-v-b1d3339e><i class="reco-bgm reco-bgm-last last" data-v-b1d3339e></i> <i class="reco-bgm reco-bgm-pause pause" style="display:none;" data-v-b1d3339e></i> <i class="reco-bgm reco-bgm-play play" data-v-b1d3339e></i> <i class="reco-bgm reco-bgm-next next" data-v-b1d3339e></i> <i class="reco-bgm reco-bgm-volume1 volume" data-v-b1d3339e></i> <i class="reco-bgm reco-bgm-mute mute" style="display:none;" data-v-b1d3339e></i> <div class="volume-bar" data-v-b1d3339e><div class="bar" data-v-b1d3339e></div></div></div></div> <div class="reco-bgm-left-box" data-v-b1d3339e data-v-41bcba48 data-v-b1d3339e><i class="reco-bgm reco-bgm-left" data-v-b1d3339e></i></div></div></div></div></div>
    <script src="./assets/js/app.7878252f.js" defer></script><script src="./assets/js/2.877879cc.js" defer></script><script src="./assets/js/80.7252ac50.js" defer></script>
  </body>
</html>
